<%--
  Created by IntelliJ IDEA.
  User: 全谢民
  Date: 2023/9/29
  Time: 11:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<script src="${path}/js/jquery-3.6.4.js" type="text/javascript" rel="script"></script>
<html>
<head>
    <title>智能购票首页</title>
    <link href="${path}/css/user_page_css/home_page.css" rel="stylesheet" type="text/css">
    <style>
        /*首页字体变色*/
        .recommend-header .type-recommend:nth-of-type(1) {
            color: #FF1268
        }

        /*a标签悬浮变小手*/
        a:hover {
            text-decoration: none;
            cursor: pointer;
        }
    </style>
</head>
<body>
<c:set var="mapList" value="${sessionScope.listMap}"></c:set>
<jsp:include page="header.jsp"></jsp:include>
<%--轮播图--%>
<div class="w1200" id="slides">
    <div class="slides_container tab-content">
        <div class="tab-pannel" style="position: absolute; z-index: 0; opacity: 1; display: block;">
            <a href="#">
                <img src="${path}/images/user_page_images/tool/Rotation1.jpg">
            </a>
        </div>
    </div>
    <div class="prev" id="J_pre">
        <div class="arrow left"></div>
    </div>
    <div class="next" id="J_next">
        <div class="arrow"></div>
    </div>
    <div class="nav">
        <div class="dot current"></div>
    </div>
</div>
<%--范围--%>
<div class="category w1200">
    <a onclick="funType('演唱会')" class="category__list">
        <span class="category__icon category__icon__ych"></span>
        <p class="category__info">演唱会</p>
    </a>
    <a onclick="funType('话剧歌剧')" class="category__list">
        <span class="category__icon category__icon__gjhj"></span>
        <p class="category__info">话剧歌剧</p>
    </a>
    <a onclick="funType('体育赛事')" class="category__list">
        <span class="category__icon category__icon__tyjj"></span>
        <p class="category__info">体育</p>
    </a>
    <a onclick="funType('儿童青子')" class="category__list">
        <span class="category__icon category__icon__qz"></span>
        <p class="category__info">儿童青子</p>
    </a>
    <a onclick="funType('展览休闲')" class="category__list">
        <span class="category__icon category__icon__zlxx"></span>
        <p class="category__info">展览休闲</p>
    </a>
    <a onclick="funType('音乐会')" class="category__list">
        <span class="category__icon category__icon__yyh"></span>
        <p class="category__info">音乐会</p>
    </a>
    <a onclick="funType('曲苑杂坛')" class="category__list">
        <span class="category__icon category__icon__xsxq"></span>
        <p class="category__info">曲苑杂坛</p>
    </a>
    <a onclick="funType('芭蕾舞蹈')" class="category__list">
        <span class="category__icon category__icon__wdbl"></span>
        <p class="category__info">芭蕾舞蹈</p>
    </a>
    <a onclick="funType('二次元')" class="category__list">
        <span class="category__icon category__icon__dm"></span>
        <p class="category__info">二次元</p>
    </a>
    <a onclick="funType('旅游展览')" class="category__list">
        <span class="category__icon category__icon__lyzl"></span>
        <p class="category__info">旅游展览</p>
    </a>
</div>
<%--中间内容大范围--%>
<div class="dm-content-wrap">

    <c:choose>
        <c:when test="${empty mapList}">
            <script>
                window.location = "${path}/servlet/userHomePage/homePageAll?userId=1"
            </script>
        </c:when>
        <c:otherwise>
            <c:forEach var="key" items="${mapList.keySet()}">
                <div class="dm-content dm-content-1" style="display: block;">
                        <%--        大标题--%>
                            <div class="head">
                                <span class="head-title">
                                      <c:forEach var="homePage" items="${mapList.get(key)}" begin="1" end="1">
                                          ${homePage.activityType}
                                      </c:forEach>
                                </span>
                                <c:forEach var="homePage" items="${mapList.get(key)}" begin="1" end="1">
                                    <a onclick="funType('${homePage.activityType}')">
                                        <span class="head-more">查看全部</span>
                                    </a>
                                </c:forEach>

                            </div>
                    <div class="box">
                            <%--下面内容--%>
                        <c:forEach var="homePage" items="${mapList.get(key)}" begin="1" end="1">
                            <a class="box-left">
                                    <%--左边内容--%>
                                <img src="../images/user_page_images/typeImages/homePageImages/${homePage.activityPicture}"
                                     class="box-left__bg">
                                <div class="box-left__info">
                                    <div class="title">${homePage.activityName}</div>
                                    <div class="details">
                                        ¥${homePage.activityStartRange}<span>起</span>
                                    </div>
                                </div>
                            </a>
                        </c:forEach>
                        <div class="box-right">
                                <%--    右边内容1--%>
                            <c:forEach var="homePage" items="${mapList.get(key)}" begin="1" end="7">
                                <a href="#" class="box-right__item">
                                        <%--左边图片--%>
                                    <div class="itemimg">
                                        <img src="../images/user_page_images/typeImages/homePageImages/${homePage.activityPicture}">
                                    </div>
                                    <div class="iteminfo">
                                            <%--右边介绍--%>
                                        <div class="title"
                                             title="${homePage.activityName}">${homePage.activityName}</div>
                                        <div class="venue">${homePage.activityAddress}</div>
                                        <div class="showtime">${homePage.activityStartDate}</div>
                                        <div class="price">¥${homePage.activityStartRange}<span>起</span></div>
                                    </div>
                                </a>
                            </c:forEach>
                        </div>
                    </div>
                </div>
            </c:forEach>
        </c:otherwise>
    </c:choose>
</div>
<jsp:include page="footer.jsp"></jsp:include>
<%--侧边--%>
<div class="sidebar">
    <div class="item J_GoTop">
        <div class="icon gotop"></div>
        <p>回到顶部</p>
    </div>
</div>
<script>

    /* function recommend(a) {
         let className=$(a).attr("class");
         alert(className);
         $(".type-recommend").attr("class","type-recommend");
         $(a).attr("class","type-recommend select");
     }*/
    function funType(typeName) {
        window.location = "${path}/servlet/userSearch/searchAll?activityType=" + typeName + "&activityName=${activityName}"
    }
</script>
</body>
</html>
